<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        //假设上传商品图片的应用场景，需要判断上传文件后缀是图片类型
        var str = "a.a.a.a.jpg"
        // 可以支持的后缀
        var allowExt = ['jpg','png'];
        
    </script>
</body>
</html>